package libaryinterface;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class UserInterface {
    JFrame f1;
    JPanel p1;
    JButton bReturn, bBorrow;

    public UserInterface() {
        f1 = new JFrame("用户界面");
        p1 = new JPanel();
        bBorrow = new JButton("借阅书籍");
        bReturn = new JButton("归还书籍");

        p1.setLayout(null);
        bReturn.setBounds(150,100,100,40);
        bBorrow.setBounds(150,160,100,40);

        f1.add(p1);
        p1.add(bBorrow);
        p1.add(bReturn);

        f1.setVisible(true);
        f1.setBounds(500,250,400,400);

        bBorrow.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new SearchInterface();
            }
        });
        bReturn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ReturnInterface();

            }
        });
        f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }


}
